package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;
import java.util.List;

public class ServiceTrackingParamsItem implements Sequenceable, Serializable {

    @SerializedName("service")
    private String service;

    @SerializedName("params")
    private List<ParamsItem> params;


    public static final Sequenceable.Producer<ServiceTrackingParamsItem> CREATOR = new Producer<ServiceTrackingParamsItem>() {
        @Override
        public ServiceTrackingParamsItem createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            ServiceTrackingParamsItem serviceTrackingParamsItem = new ServiceTrackingParamsItem();
            serviceTrackingParamsItem.unmarshalling(parcel);
            return serviceTrackingParamsItem;
        }
    };


    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeString(this.service);
        parcel.writeList(this.params);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        this.service=parcel.readString();
        this.params = parcel.readSequenceableList(ParamsItem.class);
        return true;
    }

    @Override
    public String toString() {
        return "ServiceTrackingParamsItem{" +
                "service='" + service + '\'' +
                ", params=" + params +
                '}';
    }

    public String getService() {
        return service;
    }

    public void setService(String service) {
        this.service = service;
    }

    public List<ParamsItem> getParams() {
        return params;
    }

    public void setParams(List<ParamsItem> params) {
        this.params = params;
    }
}
